<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css/bootstrap.css" rel="stylesheet" media="screen">
<title>Listagem de Tarefas</title>

</head>
<body>
	<c:import url="cabecalho.jsp" />
	<h2> Tarefas de ${nomeUsuarioLogado}</h2>
	<a href="/bcc481-tp/adicionarTarefa">Adicionar Tarefa</a><br/>
	<table class="table">
  		<tr>
  			<td>Descricao</td>
  			<td>Data Finalizacao</td>
  		</tr>
  		<c:forEach var="tarefa" items="${tarefas}">
  			<tr>
  				<td>${tarefa.descricao}</td>
  				<td><fmt:formatDate value="${tarefa.dataFinalizacao.time}" pattern="dd/MM/yyyy" /></td>
  				<td> <a href="/bcc481-tp/removerTarefa?id=${tarefa.id}">Remover</a></td>	
				<td> <a href="/bcc481-tp/alterarTarefa?id=${tarefa.id}">Alterar</a></td>
  			</tr>	
  		</c:forEach>
  		
  	</table>
  	
  	<a href="/bcc481-tp/logoff">Logoff</a><br/>
  	
</body>
</html>